from pymongo import MongoClient
import configparser
from datetime import datetime


def parcon(sec):
    conf = configparser.ConfigParser()
    conf.read("E:\pymon\mn.conf")
    if sec:
        uri = conf.get(sec, "uri")
    else:
        return 0
    return uri


client = parcon(sec)
db = client.test
clo = db.heartbeat

def update(db,clo):
    date = datetime.now()
    tiem = date.strftime("%Y-%m-%d %H:%M:%S")
    result = db.clo.update_one(
    	{"name": "heartbeat"},
    	{
    		"$set": {
    			"cuisine": "American (New)"
    		},
    		"$currentDate": {"lastModified": True}
    	}
    )



if __name__ == '__main__':
    insert()
